<html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">
dt {
  font-style: italic;
  margin-top: 15px;
  margin-bottom: 3px;
  margin-left: 0px;
  border-bottom: 1px dotted black;
}
dd {
  margin-left: 10px;
}
table {
  border-collapse:collapse;
  border: 1px solid black;
  margin-top: 7px;
}
th {
  border: 1px solid black;
  padding: 3 7 3 7;
}
td {
  border: 1px solid black;
  padding: 3 7 3 7;
}
</style></head><body><p><a name="aload_n"></a><b>aload_n</b> :
  retrieve object reference from local variable &lt;n&gt; : <a href="opcodes.html">index</a> : </p><dl><dt>Description</dt><dd>aload_n represents the series of opcodes
aload_0, aload_1, aload_2, and aload_3 that
retrieve an object reference held in local variables 0, 1, 2 or 3 and push it
onto the stack. &lt;n&gt; must be a valid local variable number in the current
frame.<br></br>'aload_n' is functionally equivalent to 'aload
&lt;n&gt;', although it is typically more efficient and also takes fewer
bytes in the bytecode.</dd><dt>Example</dt><dd><pre>
aload_0         ;push object in local variable 0
aload_1         ;push object in local variable 1
aload_2         ;push object in local variable 2
aload_3         ;push object in local variable 3
</pre></dd><dt>Notes</dt><dd>If you use astore to store a returnAddress in a local variable,
you cannot then use aload_n to retrieve the value of that
local variable. Instead, if a local variable holds a returnAddress, your only
choices are to (1) use ret to return to that address, or (2) use one
of the store instructions to store some other value in the local variable.</dd><dt>See also</dt><dd><a href="ref-fload.html">fload</a> <a href="ref-.html"></a> <a href="ref-iload.html">iload</a> <a href="ref-.html"></a> <a href="ref-lload.html">lload</a> <a href="ref-.html"></a> <a href="ref-dload.html">dload</a> </dd><dt>Stack</dt><dd><table xmlns="">
<tr>
<td>
<b>Before </b>
</td>
<td><b>After</b></td></tr>
<tr>
<td>...</td>
<td>objectref</td></tr>
<tr>
<td></td>
<td>...</td></tr>
</table></dd><dt>Bytecode</dt><dd><table xmlns="">
<tr>
<td>
<b> Type </b>
</td>
<td><b>Description</b></td></tr>
<tr>
<td>
u1 
</td>
<td>aload_0
opcode = 0x2A (42)
</td></tr>
<tr>
<td>
u1 
</td>
<td>aload_1
opcode = 0x2B (43)
</td></tr>
<tr>
<td>
u1 
</td>
<td>aload_2
opcode = 0x2C (44)
</td></tr>
<tr>
<td>
u1 
</td>
<td>aload_3
opcode = 0x2D (45)
</td></tr>
</table></dd></dl></body></html>